package pers.xuyong.strive.datastruct.tree;

/**
 * 节点
 *
 * @author billymac
 * @version 1.0
 * @date 17/8/7  上午11:05
 * @since JDK1.8
 */
public class Node {
    //节点key
    Integer key;

    //节点value
    Double value;

    //左子节点
    Node leftNode;

    //右子节点
    Node rightNode;

    public Node() {
        this(null, null, null, null);
    }

    public Node(Integer key, Double value) {
        this(key, value, null, null);
    }

    public Node(Integer key, Double value, Node leftNode, Node rightNode) {
        this.key = key;
        this.leftNode = leftNode;
        this.rightNode = rightNode;
        this.value = value;
    }

    /**
     * 节点展示
     */
    public void display() {
        System.out.println("key : " + key + ", value : " + value);
    }
}
